package coms.dto;

import java.io.Serializable;

public class Location implements Serializable{

    private int id;

    private String locationName;
    private String address1;
    private String address2;
    private String address3;
    private String city;
    private String country;
    private String postalCode;
    
    public Location(){

    }
    
    public String getAddress1() {
        return address1;
    }

    public void setAddress1(String address1) {
        this.address1 = address1;
    }

    public String getAddress2() {
        return address2;
    }

    public void setAddress2(String address2) {
        this.address2 = address2;
    }

    public String getAddress3() {
        return address3;
    }

    public void setAddress3(String address3) {
        this.address3 = address3;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    public String getPostalCode() {
        return postalCode;
    }

    public void setPostalCode(String postalCode) {
        this.postalCode = postalCode;
    }
    
    
    public String getAddress(){
    
    return toString();
    }
    
    @Override
    public String toString()
    {
       String address="";
       if(!getLocationName().equals(""))
       {
           address+=getLocationName()+"\n";
       }
       if(!getAddress1().equals(""))
       {
           address+=getAddress1()+"\n";
       }
       if(!getAddress2().equals(""))
       {
           address+=getAddress2()+"\n";
       }
       if(!getAddress3().equals(""))
       {
           address+=getAddress3()+"\n";
       }
       if(!getCity().equals(""))
       {
           address+=getCity()+",";
       }
       if(!getCountry().equals(""))
       {
           address+=getCountry();
       }
       if(!getPostalCode().equals(""))
       {
           address+="-"+getPostalCode();
       }
       return address;
       
    }
    
}